package com.dao;

import com.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
//import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserMapper {
    @Insert("insert into user (id ,password,position ,email,phone ,name,sex ,birth) values (#{id}, #{password},#{position}, #{email},#{phone}, #{name},#{sex}, #{birth})")
    boolean insert(User user);

    @Update("insert into user (username, password) values (#{username}, #{password})")
    boolean update(User user);

    @Select("select * from user where email = #{email}")
    User query(String position);

    @Select("select * from user")
    List<User> selectAllSalesman();
}
